package org.eden.heartbeat.client.model;

/**
 * Available application commands.
 *
 * @author trsimoes
 * @version $Revision:$
 */
public enum ArgumentOption {
    /**
     * Stops the application
     */
    STOP("stop"),

    /**
     * Reloads the application configurations stored in the database.
     */
    RELOAD_CONFIGURATIONS("reload"),

    /**
     * Returns the amount of time that the remote machine has been offline.
     */
    GET_TODAY_OFFLINE_TIME("getOfflineTime");

    private String value;

    private ArgumentOption(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static ArgumentOption fromValue(String value) {
        ArgumentOption[] argumentOptions = ArgumentOption.values();
        for (ArgumentOption argumentOption : argumentOptions) {
            if (argumentOption.getValue().equalsIgnoreCase(value)) {
                return argumentOption;
            }
        }
        return null;
    }
}